<!-- 我的弹窗 -->

<template>
  <WebModal>
    <WebForm>
      <EasyRow col2>
        <FormInput label="图表标识" bind="dashboardCode" :max="20" required />
        <FormSelect label="图表类型" bind="dashboardType" :dict="DICT.TYPE" />
      </EasyRow>

      <EasyRow col2>
        <FormInput label="图表名称" bind="dashboardName" :max="10" required />
        <FormSelect label="所属页面" bind="boardCode" :dict="DICT.DASHBOARD" initFirst required />
      </EasyRow>

      <FormPhoto label="预览图" bind="fileUrl" folder="dashboard" isPublic quar required />

      <div class="flex">
        <FormLink label="接口地址" bind="apiUrl" lazy @change="startOne" />
        <FormSlot :labelWidth="20" flex0>
          <BtnPrimary title="测试" :disabled="!CORE.validLink(one.apiUrl)" @click="startOne" />
        </FormSlot>
      </div>

      <FormCheckbox v-if="readyOne" label="字段选择" bind="apiConfig" :dict="one.fieldDict" join />
      <FormCheckbox v-else label="字段选择" :dict="one.fieldDict" />
    </WebForm>
  </WebModal>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyModal',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),
}
</script>
